import axios from "axios";
import {RequireAdapter} from "@/api/types";

export const serverAdapter: RequireAdapter<any> = async (url, data) => {
  let BASE_URL: string | undefined = undefined;
  if (import.meta.env.DEV) {
    BASE_URL = 'http://localhost:52411';
  }
  const rsp = await axios.request({
    baseURL: BASE_URL,
    // TODO: 认证信息在这里

    method: 'POST',
    url,
    data
  });
  return rsp.data;
}